package base.thread.state.yield;

/**
 * @Author: my_code
 * @Create: 2020-12-08 13:40
 */
public class MyYield implements Runnable {

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName() + "线程开始");
        Thread.yield();  //线程礼让：此线程让出CUP，重新争抢CPU资源
        System.out.println(Thread.currentThread().getName() + "线程结束");
    }
}
